//package com.muyu.danmo.util;
//
//import com.muyu.danmo.domain.DanmoGalleryWorks;
//import com.muyu.danmo.service.impl.DanmoGalleryWorksServiceImpl;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Component;
//
//import java.util.List;
//
//@Component
//public class AuctionScheduler {
//
//    @Autowired
//    private DanmoGalleryWorksServiceImpl danmoGalleryWorksService;
//
//    @Scheduled(fixedRate = 60000) // 每分钟检查一次
//    public void checkAndEndAuction() {
//        DanmoGalleryWorks danmoGalleryWorks = new DanmoGalleryWorks();
//        List<DanmoGalleryWorks> auctions = danmoGalleryWorksService.selectDanmoGalleryWorksList(danmoGalleryWorks);
//        for (DanmoGalleryWorks auction : auctions) {
//            danmoGalleryWorksService.endAuction(auction.getId());
//        }
//    }
//}
